<?php session_start();
 ?>
<html>
    <head>
        <title>UNHM Internships</title>
        <link rel="stylesheet" type="text/css" href="css/style.css" />
    </head>
    <body>
        <form action="index.php" method="post">
            <table width="100%"><div align="left">
                <tr><td rowspan="5"><img src="img/unhmlogo.png" width="200px" height="120px" /></td></tr>
                <tr><td><h3>UNHM Internships</h3><br /></td><td align="right" valign="top"><a href="login.php">Login</a> | </td><td align="left" valign="top"><a href="help.php">?</a></tr>
                <tr><td><p>Search for an internship opportunity by:</p></td></tr>
                <tr><td>
                        <input type="submit" class="submit" value="Company" name="repCompanies" />
                        <!--<input type="submit" class="submit" value="Interest" name="repInterest" />-->
                        <input type="submit" class="submit" value="Semester" name="repSemester" />
                        <input type="submit" class="submit" value="Location" name="repLocation" />
                        <input type="submit" class="submit" value="Paid" name="repPaid" />
                        <input type="submit" class="submit" value="Date Added" name="repDateAdded" />
                    </td></tr>
                <tr><td>
                        <?php
                        require 'inc/functions.php';
                           connectToDatabase();
                            $_SESSION['category'] = $_POST['categoryChange'];
                            echo "<br />";
                            showCategories($_SESSION['category']);
                        ?>
                        <hr /></td></tr>
                
            </table>
        </form>
        <?php
        If (isset($_POST['repCompanies'])) {
            filterCompany();
        }
        If (isset($_POST['cityChange'])) {
            filterLocation($_POST['cityChange']);
        }
        If (isset($_POST['repLocation'])) {
            filterLocation(null);
        }
        If (isset($_POST['viewCompany'])) {
            viewCompany($_POST['viewCompany']);
        }
        If (isset($_POST['repPaid'])) {
            filterPaid();
        }
        If (isset($_POST['repDateAdded'])) {
            filterDate();
        }
        ?>

    </body>
</html>
